<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset ="UTF-8">
    <title>AllLessonList</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <style>
        table{
            border: 1px solid;
            margin: auto;
            width: 1300px;
        }
        td,th{
            text-align: center;
            border: 1px solid;
            height: 35px;
        }

        body {
            background-image: url("background.png");
            background-repeat: no-repeat;
            background-position: center center;
            background-size: cover;
        }

    </style>

</head>
<body>

<br>
<div style="text-align: center">欢迎，<%=request.getSession().getAttribute("identity")%>&nbsp;<%=request.getSession().getAttribute("username")%></div>
<div style="text-align: center">可申请课程信息表</div>

<table>
    <caption></caption>
    <tr>
        <th>编号</th>
        <th>课名</th>
        <th>老师</th>
        <th>状态</th>
        <th>申请原因</th>
        <th>驳回原因</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${lessons}" var="lesson">
        <c:if test="${lesson.status==4}">
            <tr>
                <td>${lesson.code}</td>
                <td>${lesson.name}</td>
                <td>${lesson.teacher}</td>
                <c:if test="${lesson.status==0}"><td>未申请</td></c:if>
                <c:if test="${lesson.status==1}"><td>待审批</td></c:if>
                <c:if test="${lesson.status==2}"><td>主讲审批通过,主管待审批</td></c:if>
                <c:if test="${lesson.status==3}"><td>主讲已驳回</td></c:if>
                <c:if test="${lesson.status==4}"><td>审批通过</td></c:if>
                <c:if test="${lesson.status==5}"><td>主管已驳回</td></c:if>
                <td>${lesson.applyreason}</td>
                <td>${lesson.disapprovereason}</td>
                <c:if test="${lesson.status==0}"><td><a href="lessonUpdateStatusServlet?method=doGet&code=${lesson.code}&name=${lesson.name}&teacher=${lesson.teacher}&status=${lesson.status}">申请</a></td></c:if>
                <c:if test="${lesson.status==1||lesson.status==2||lesson.status==3||lesson.status==4||lesson.status==5}"><td><a href="lessonUpdateStatusServlet?method=doGet&code=${lesson.code}&name=${lesson.name}&teacher=${lesson.teacher}&status=${lesson.status}">取消</a></td></c:if>
            </tr>
        </c:if>
    </c:forEach>

</table>
<div class="container" style="width: 400px;">
    <h3 style="text-align: center;"></h3>
    <form action="/lessonListServlet" method="post">
        <div class="form-group" style="text-align: center;">
            <input class="btn btn btn-primary" type="submit" value="查询所有课程">
        </div>
    </form>
</div>
<script>

</script>
</body>
</html>